
import java.awt.BorderLayout;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.awt.event.WindowStateListener;
import javax.swing.JButton;
import javax.swing.JDesktopPane;
import javax.swing.JPanel;
import javax.swing.WindowConstants;
 
/**
* This code was edited or generated using CloudGarden's Jigloo
* SWT/Swing GUI Builder, which is free for non-commercial
* use. If Jigloo is being used commercially (ie, by a corporation,
* company or business for any purpose whatever) then you
* should purchase a license for each developer using Jigloo.
* Please visit www.cloudgarden.com for details.
* Use of Jigloo implies acceptance of these licensing terms.
* A COMMERCIAL LICENSE HAS NOT BEEN PURCHASED FOR
* THIS MACHINE, SO JIGLOO OR THIS CODE CANNOT BE USED
* LEGALLY FOR ANY CORPORATE OR COMMERCIAL PURPOSE.
*/
public class ScreenFrame extends javax.swing.JFrame {

	private java.net.Socket socket=null;
	private JDesktopPane jDesktopPane1;
	public ScreenFrame(java.net.Socket s) {
		super();
		this.socket = s;
		initGUI();
	}

	private void initGUI() {
		try {
			setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
			getContentPane().setLayout(null);
			this.addWindowListener(new WindowAdapter() {
				public void windowClosed(WindowEvent evt) {
					rootWindowClosed(evt);
				}
			});
			pack();
			//get screen size
			java.awt.Dimension dimension = java.awt.Toolkit.getDefaultToolkit().getScreenSize();
			this.setSize((int)dimension.width-50, (int)dimension.height-50);
			{
				jDesktopPane1 = new scrPanal(this.socket,dimension);
				getContentPane().add(jDesktopPane1);
				jDesktopPane1.setBounds(0, 0, (int)dimension.width-50, (int)dimension.height-50);
			}
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
	
	private void rootWindowClosed(WindowEvent evt) {
	try{
		socket.close();
	}catch(Exception e){
		e.printStackTrace();
	}
	}

}
